using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class System_Globalization_NumberStyles_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            FieldInfo field;
            Type[] args;
            Type type = typeof(System.Globalization.NumberStyles);

            field = type.GetField("None", flag);
            app.RegisterCLRFieldGetter(field, get_None_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_None_0, null);
            field = type.GetField("AllowLeadingWhite", flag);
            app.RegisterCLRFieldGetter(field, get_AllowLeadingWhite_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowLeadingWhite_1, null);
            field = type.GetField("AllowTrailingWhite", flag);
            app.RegisterCLRFieldGetter(field, get_AllowTrailingWhite_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowTrailingWhite_2, null);
            field = type.GetField("AllowLeadingSign", flag);
            app.RegisterCLRFieldGetter(field, get_AllowLeadingSign_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowLeadingSign_3, null);
            field = type.GetField("AllowTrailingSign", flag);
            app.RegisterCLRFieldGetter(field, get_AllowTrailingSign_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowTrailingSign_4, null);
            field = type.GetField("AllowParentheses", flag);
            app.RegisterCLRFieldGetter(field, get_AllowParentheses_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowParentheses_5, null);
            field = type.GetField("AllowDecimalPoint", flag);
            app.RegisterCLRFieldGetter(field, get_AllowDecimalPoint_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowDecimalPoint_6, null);
            field = type.GetField("AllowThousands", flag);
            app.RegisterCLRFieldGetter(field, get_AllowThousands_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowThousands_7, null);
            field = type.GetField("AllowExponent", flag);
            app.RegisterCLRFieldGetter(field, get_AllowExponent_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowExponent_8, null);
            field = type.GetField("AllowCurrencySymbol", flag);
            app.RegisterCLRFieldGetter(field, get_AllowCurrencySymbol_9);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowCurrencySymbol_9, null);
            field = type.GetField("AllowHexSpecifier", flag);
            app.RegisterCLRFieldGetter(field, get_AllowHexSpecifier_10);
            app.RegisterCLRFieldBinding(field, CopyToStack_AllowHexSpecifier_10, null);
            field = type.GetField("Integer", flag);
            app.RegisterCLRFieldGetter(field, get_Integer_11);
            app.RegisterCLRFieldBinding(field, CopyToStack_Integer_11, null);
            field = type.GetField("HexNumber", flag);
            app.RegisterCLRFieldGetter(field, get_HexNumber_12);
            app.RegisterCLRFieldBinding(field, CopyToStack_HexNumber_12, null);
            field = type.GetField("Number", flag);
            app.RegisterCLRFieldGetter(field, get_Number_13);
            app.RegisterCLRFieldBinding(field, CopyToStack_Number_13, null);
            field = type.GetField("Float", flag);
            app.RegisterCLRFieldGetter(field, get_Float_14);
            app.RegisterCLRFieldBinding(field, CopyToStack_Float_14, null);
            field = type.GetField("Currency", flag);
            app.RegisterCLRFieldGetter(field, get_Currency_15);
            app.RegisterCLRFieldBinding(field, CopyToStack_Currency_15, null);
            field = type.GetField("Any", flag);
            app.RegisterCLRFieldGetter(field, get_Any_16);
            app.RegisterCLRFieldBinding(field, CopyToStack_Any_16, null);


            app.RegisterCLRCreateDefaultInstance(type, () => new System.Globalization.NumberStyles());
            app.RegisterCLRCreateArrayInstance(type, s => new System.Globalization.NumberStyles[s]);


        }

        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref System.Globalization.NumberStyles instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch(ptr_of_this_method->ObjectType)
            {
                case ObjectTypes.Object:
                    {
                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
                    }
                    break;
                case ObjectTypes.FieldReference:
                    {
                        var ___obj = __mStack[ptr_of_this_method->Value];
                        if(___obj is ILTypeInstance)
                        {
                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            var t = __domain.GetType(___obj.GetType()) as CLRType;
                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                        }
                    }
                    break;
                case ObjectTypes.StaticFieldReference:
                    {
                        var t = __domain.GetType(ptr_of_this_method->Value);
                        if(t is ILType)
                        {
                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                        }
                    }
                    break;
                 case ObjectTypes.ArrayReference:
                    {
                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Globalization.NumberStyles[];
                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
                    }
                    break;
            }
        }


        static object get_None_0(ref object o)
        {
            return System.Globalization.NumberStyles.None;
        }

        static StackObject* CopyToStack_None_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.None;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowLeadingWhite_1(ref object o)
        {
            return System.Globalization.NumberStyles.AllowLeadingWhite;
        }

        static StackObject* CopyToStack_AllowLeadingWhite_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowLeadingWhite;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowTrailingWhite_2(ref object o)
        {
            return System.Globalization.NumberStyles.AllowTrailingWhite;
        }

        static StackObject* CopyToStack_AllowTrailingWhite_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowTrailingWhite;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowLeadingSign_3(ref object o)
        {
            return System.Globalization.NumberStyles.AllowLeadingSign;
        }

        static StackObject* CopyToStack_AllowLeadingSign_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowLeadingSign;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowTrailingSign_4(ref object o)
        {
            return System.Globalization.NumberStyles.AllowTrailingSign;
        }

        static StackObject* CopyToStack_AllowTrailingSign_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowTrailingSign;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowParentheses_5(ref object o)
        {
            return System.Globalization.NumberStyles.AllowParentheses;
        }

        static StackObject* CopyToStack_AllowParentheses_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowParentheses;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowDecimalPoint_6(ref object o)
        {
            return System.Globalization.NumberStyles.AllowDecimalPoint;
        }

        static StackObject* CopyToStack_AllowDecimalPoint_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowDecimalPoint;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowThousands_7(ref object o)
        {
            return System.Globalization.NumberStyles.AllowThousands;
        }

        static StackObject* CopyToStack_AllowThousands_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowThousands;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowExponent_8(ref object o)
        {
            return System.Globalization.NumberStyles.AllowExponent;
        }

        static StackObject* CopyToStack_AllowExponent_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowExponent;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowCurrencySymbol_9(ref object o)
        {
            return System.Globalization.NumberStyles.AllowCurrencySymbol;
        }

        static StackObject* CopyToStack_AllowCurrencySymbol_9(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowCurrencySymbol;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_AllowHexSpecifier_10(ref object o)
        {
            return System.Globalization.NumberStyles.AllowHexSpecifier;
        }

        static StackObject* CopyToStack_AllowHexSpecifier_10(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.AllowHexSpecifier;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Integer_11(ref object o)
        {
            return System.Globalization.NumberStyles.Integer;
        }

        static StackObject* CopyToStack_Integer_11(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.Integer;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_HexNumber_12(ref object o)
        {
            return System.Globalization.NumberStyles.HexNumber;
        }

        static StackObject* CopyToStack_HexNumber_12(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.HexNumber;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Number_13(ref object o)
        {
            return System.Globalization.NumberStyles.Number;
        }

        static StackObject* CopyToStack_Number_13(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.Number;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Float_14(ref object o)
        {
            return System.Globalization.NumberStyles.Float;
        }

        static StackObject* CopyToStack_Float_14(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.Float;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Currency_15(ref object o)
        {
            return System.Globalization.NumberStyles.Currency;
        }

        static StackObject* CopyToStack_Currency_15(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.Currency;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Any_16(ref object o)
        {
            return System.Globalization.NumberStyles.Any;
        }

        static StackObject* CopyToStack_Any_16(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = System.Globalization.NumberStyles.Any;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


        static object PerformMemberwiseClone(ref object o)
        {
            var ins = new System.Globalization.NumberStyles();
            ins = (System.Globalization.NumberStyles)o;
            return ins;
        }


    }
}
